package com.ido.otaclient;


/**
 * Copyright (c) 2019 深圳市爱都科技有限公司. All rights reserved.
 *
 * @Author: xyb
 * @CreateDate: 2020-02-21 18:09
 * @description 升级状态
 */
public enum StatusUpgrade {
    WAITING(0),
    UPGRADE(1),
    COMPLETE(2),
    FAIL(3);

    int code;
    StatusUpgrade(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static StatusUpgrade get(int code) {
        if (WAITING.getCode() == code) {
            return WAITING;
        } else if(UPGRADE.getCode() == code){
            return UPGRADE;
        } else if(COMPLETE.getCode() == code){
            return COMPLETE;
        }else {
            return FAIL;
        }
    }
}
